package com.liu.project.controller;

import com.liu.project.pojo.Subject;
import com.liu.project.service.SubjectService;
import com.liu.project.utils.Message;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiResponse;
import javafx.scene.SubScene;
import net.sf.jsqlparser.statement.select.SubSelect;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.List;

/**
 * @program: project
 * @description:
 * @author: 86187
 * @create: 2022-03-20 15:52
 **/
@Api(tags = "获取学科门类列表")
@Controller
@RequestMapping("/api/subject")
public class SubjectController {

    @Autowired
    SubjectService subjectService;

    @PostMapping("/")
    @ApiResponse(code = 200,message = "请求成功")
    @ResponseBody
    public Message<List<Subject>> getAllSubject(){
        List<Subject> all = subjectService.getAll();
        return new Message<>(200, "请求成功", all);

    }
}
